package org.utahgtug.site.view;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.utahgtug.site.model.BlogPost;
import org.utahgtug.site.service.BlogPostService;

import java.util.List;

/**
 * Created by IntelliJ IDEA.
 * User: gmdayley
 * Date: 12/28/11
 * Time: 12:41 PM
 * To change this template use File | Settings | File Templates.
 */
@Controller
@RequestMapping(value = "/blog")
public class BlogPostController {

	@Autowired private BlogPostService bloggerService;

    @RequestMapping(value = "/posts")
    public @ResponseBody List<BlogPost> getAllPosts(){
        return bloggerService.getAllPosts();
    }

}
